<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>门诊挂号界面</title>
    <link rel="stylesheet" href="../css/convenient.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/convenient.js"></script>
</head>
<body>
<div class="convenientOper">
    <button id="convenientOperAddBtn">新增挂号</button>
</div>
<hr/>
<!--历史信息显示-->
<div class="conveninetInformationShow">
    <table id="tb_convenient" cellspacing="0" cellpadding="2" width="100%" border="1">
        <tr align="center" bgcolor="#dcdcdc">
            <td style="width:30px;"><input id="convenientInformationShowFather" type="checkbox"></td>
            <td>病人姓名</td>
            <td>性别</td>
            <td>年龄</td>
            <td>联系方式</td>
            <td>过往病史</td>
            <td>挂号号码</td>
            <td>操作</td>
        </tr>
        <!--<tr>-->
            <!--<td style="width:30px;"><input class="conveninentInformationShowSon" type="checkbox"></td>-->
            <!--<td>张三</td>-->
            <!--<td>男</td>-->
            <!--<td>28</td>-->
            <!--<td>17887195689</td>-->
            <!--<td>无</td>-->
            <!--<td>201901091307</td>-->
            <!--<td>-->
                <!--<button data-id="" class="convenientInformationShowUpdateBtn">编辑</button>-->
                <!--<button data-id="" class="convenientInformationShowCancelBtn">删除</button>-->
            <!--</td>-->
        <!--</tr>-->
    </table>
</div>
<!--新增界面界面显示-->
<div class="convenientAdd">
    <div>
        <label for="convenientAddInputName">病人姓名</label>
        <input class="convenientAddInput" id="convenientAddInputName" placeholder="请输入姓名">
        <span id="judgeName"></span>
    </div>
    <div>
        <label for="convenientAddInputSex">病人性别</label>
        <input class="convenientAddInput" id="convenientAddInputSex" placeholder="请输入性别">
        <span id="judgeSex"></span>
    </div>
    <div>
        <label for="convenientAddInputAge">病人年龄</label>
        <input class="convenientAddInput" id="convenientAddInputAge" placeholder="请输入年龄">
        <span id="judgeAge"></span>
    </div>
    <div>
        <label for="convenientAddInputNation">病人民族</label>
        <input class="convenientAddInput" id="convenientAddInputNation" placeholder="请输入民族">
        <span id="judgeNation"></span>
    </div>
    <div>
        <label for="convenientAddInputContact">联系方式</label>
        <input class="convenientAddInput" id="convenientAddInputContact" placeholder="请输入联系方式">
        <span id="judgeContact"></span>
    </div>
    <div>
        <label for="convenientAddInputDisHis">过往病史</label>
        <input class="convenientAddInput" id="convenientAddInputDisHis" placeholder="请输入过往病史">
        <span id="judgeDisease"></span>
    </div>
    <div>
        <button id="convenientAddSureBtn">确认</button>
        <button id="convenientAddBackBtn">返回</button>
    </div>
    <!--<div class="convenientNumShow">创建成功：ahsdhshahhahd</div>-->
</div>
<!--编辑框-->
<div class="convenientClickUpdateGetInfo">
    <div>
        <label for="PatientName">病人姓名</label>
        <input type="text" class="patient" id="PatientName" value="">
    </div>
    <div>
        <label for="patientSex">病人性别</label>
        <input type="text" class="patient" id="patientSex" value="">
    </div>
    <div>
        <label for="patientAge">病人年龄</label>
        <input type="text" class="patient" id="patientAge" value="">
    </div>
    <div>
        <label for="patientContact">联系方式</label>
        <input type="text" class="patient" id="patientContact" value="">
    </div>
    <div>
        <label for="patientDisHis">过往病史</label>
        <input type="text" class="patient" id="patientDisHis" value="">
    </div>
    <div>
        <label for="patientConven">挂号号码</label>
        <input type="text" class="patient" id="patientConven" value="" disabled="disabled">
    </div>
    <div>
        <button id="patientclickUpdateGetInfoSureBtn">确认</button>
        <button id="patientclickUpdateGetInfoBackBtn">返回</button>
    </div>
</div>
<div id="over"></div>
<!--表格宽度可伸缩事件-->
<script type="text/javascript">
    var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
    var table = document.getElementById("tb_convenient");
    for (j = 0; j < table.rows[0].cells.length; j++) {
        table.rows[0].cells[j].onmousedown = function () {
//记录单元格
            tTD = this;
            if (event.offsetX > tTD.offsetWidth - 10) {
                tTD.mouseDown = true;
                tTD.oldX = event.x;
                tTD.oldWidth = tTD.offsetWidth;
            }
//记录Table宽度
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
//tTD.tableWidth = table.offsetWidth;
        };
        table.rows[0].cells[j].onmouseup = function () {
//结束宽度调整
            if (tTD == undefined) tTD = this;
            tTD.mouseDown = false;
            tTD.style.cursor = 'default';
        };
        table.rows[0].cells[j].onmousemove = function () {
//更改鼠标样式
            if (event.offsetX > this.offsetWidth - 10)
                this.style.cursor = 'col-resize';
            else
                this.style.cursor = 'default';
//取出暂存的Table Cell
            if (tTD == undefined) tTD = this;
//调整宽度
            if (tTD.mouseDown != null && tTD.mouseDown == true) {
                tTD.style.cursor = 'default';
                if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
                    tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
//调整列宽
                tTD.style.width = tTD.width;
                tTD.style.cursor = 'col-resize';
//调整该列中的每个Cell
                table = tTD;
                while (table.tagName != 'TABLE') table = table.parentElement;
                for (j = 0; j < table.rows.length; j++) {
                    table.rows[j].cells[tTD.cellIndex].width = tTD.width;
                }
//调整整个表
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
//table.style.width = table.width;
            }
        };
    }
</script>
</body>
</html>